﻿<link href="@Url.Content("~/content/activitie_list.css")" rel="stylesheet" type="text/css"/>

@model PagedList<BulletinModel.Bulletin>
@using Webdiyer.WebControls.Mvc;
@{
    ViewBag.Title = "Index";
}

<h2>公 示</h2>

<div id="operate"><span>　</span>
    @if (User.Identity.Name!=""){
        @Html.ActionLink("新建", "Create")
    }
</div>

<div id="itemList">
@foreach (var item in Model) {
    <dl onclick="window.location.href='/BulletinItem/Details?BulletinID='+this.id+'&BulletinYaMa=1';" id=@item.ID>
        <dt>
            @*@Html.DisplayFor(modelItem => item.Name)*@
            @Html.ActionLink(item.Name,"Details", "BulletinItem",new { BulletinID=item.ID,BulletinYaMa=ViewData["YeMa"] },null) 
        </dt>
        <dd class="desc">
            @item.Description
@*            @{
                string description = item.Description;
                description = description.StripHtmlTags();
                description = description.Truncate(150);                
              }
            @Html.DisplayFor(modelItem => description)*@
        </dd>
       <dd class="link">
            @Html.ActionLink("详细","Details", "BulletinItem",new { BulletinID=item.ID,BulletinYaMa=ViewData["YeMa"] },null) 
            @if (User.Identity.Name != "") 
            {
                @Html.ActionLink("删除", "Delete", new { id=item.ID,BulletinYaMa=ViewData["YeMa"] })
            }
        </dd>
    </dl>
}
</div>


<table width="800" class="oddTable" style="margin-bottom:10px; display:none;">
    <tr>
        <th width="200">名称</th>
        <th>说明</th>
            @if (User.Identity.Name != "") 
            { 
                     <th width="105">操作</th>
            }
    </tr>

@foreach (var item in Model) {
    <tr>
        <td style="text-align:center;">
      @*      @item.Name*@
            @Html.ActionLink(item.Name,"Details", "BulletinItem",new { BulletinID=item.ID,BulletinYaMa=ViewData["YeMa"] },null) 
        </td>
        <td>@item.Description</td>
       
@*            @Html.ActionLink("详细","Details", "BulletinItem",new { BulletinID=item.ID,BulletinYaMa=ViewData["YeMa"] },null) *@
            @if (User.Identity.Name != "") 
            { 
                 <td style="text-align:center;">
            @Html.ActionLink("删除", "Delete", new { id=item.ID,BulletinYaMa=ViewData["YeMa"] })
                             </td>
            }


    </tr>
}
</table>
        @Html.Pager( Model ,new PagerOptions()
        {
    PageIndexParameterName = "id",
    //ShowPageIndexBox = true
    //ShowGoButton = true,
    //PageIndexBoxWrapperFormatString = "跳转到第{0}页"
        })